FIG. 7 is a drawing to show the use state of the transmitter terminal and the receiver terminal mentioned above. In FIG. 7, a transmitter terminal 11 divides real-time stream data such as audio and video into packets for transmission to a receiver terminal 12 through a network 10.
A network of the Internet, etc., may be put into a wider bandwidth and a VPN (Virtual Private Network) router may be speeded up by performing link trunking or introducing a plurality of encryption devices. FIG. 8 is a drawing to show an example. In FIG. 8, routers (relays) 801, 802, and 803 placed in a network intervene between the transmitter terminal 11 and the receiver terminal 12. In FIG. 8, the transmitter terminal 11 and the router 801 are connected by a link 804, the router 801 and the router 802 are connected by a link 805, the router 802 and the router 803 are connected by a link 806, and the receiver terminal 12 and the router 803 are connected by a link 807. In such a network, for example, if the bandwidth of the link 805 becomes insufficient because of an increase in the traffic, a method of bundling a plurality of links to ensure the bandwidth may be adopted. This is called link trunking. The link 805 shows a state in which a plurality of links are bundled.
FIG. 9 is a drawing to show a state of link selection of the router 801 where link trunking is performed in more detail. In the figure, four links 804, 805-1, 805-2, and 805-3 are connected to the router 801. The router 801 has output queues 903, 904, and 905 for the links 804 and 805-1 to 805-3. A scheduler 902 of the router 801 has a function of determining the output link of a packet. Packets 909, 1001, and 1002 different in length are output from the output queues 903, 904, and 905 to the links. That is, the packet 909 is output from the output queue 903 to the link 805-1, and the packet 1001 is output from the output queue 904 to the link 805-2. The packet 1002 is output from the output queue 905 to the link 805-3.
In FIG. 8, when a packet is input from the link 804, etc., the router 801 executes routing and determines transmission of the packet to the destination of the routing result using the link 805, namely, any of the links 805-1 to 805-3 in FIG. 9. The scheduler 902 of the router 801 determines which of the links 805-1, 805-2, and 805-3 is to be used, and stores the packet in the output queue corresponding to the determined link. At this time, which link is selected is determined by the value set in the router 801. Specifically, a round robin system of selecting a link to store the packet in order and a system of calculating the hash value in a specific area in the packet and selecting the link according to the hash value are known. The packets stored in the output queues 903, 904, and 905 are transferred to the associated router (in FIG. 8, the router 802) through each link in sequence (First In First Out) in response to the link speed.
Inversion of the packet reception order may occur between the routers where such link trunking is performed. In the description, reorder of packet is defined as transmission of the packet while the packet transmission order output by the transmitter terminal and the reception order of the packet received by the receiver terminal differ. In the example in FIG. 9, although the packets 909, 1001, and 1002 are transmitted in this order from the transmitter terminal 11, these packets are received at the receiver terminal 12 in the order of the packets 909, 1002, and 1001. This is a representative example wherein reorder occurs because of link trunking.
In addition, it is assumed that measures are taken for preventing content of data from being seen if network snooper obtains the data at a network link by conducting encryption between the router 801 and the router 803. If transmission between the transmitter terminal 11 and the receiver terminal 12 is put into a wider bandwidth under such an operation condition, the capability of encryption and decryption installed in the routers 801 and 803 may become insufficient. Thus, a plurality of hardware devices of encryption and decryption are installed in the routers 801 and 803 and encryption and decryption processing is assigned to the devices for each arrival packet, whereby encryption and decryption processing may be speeded up. If a plurality of hardware devices for encryption and decryption are installed in the routers 801 and 803, reorder may occur. The encryption and decryption processing time generally is prolonged in response to the packet length. That is, in encryption and decryption processing of the routers 801 and 803, if encryption and decryption processing is started roughly at the same time, processing of a shorter packet may terminate in a shorter time than processing of a longer packet. If a short packet arrives at such a router from a specific transmitter terminal, reorder may occur.
In transmission of streaming data in real time such as audio and video, it becomes necessary for a receiver terminal where reorder occurs to sort the packets. That is, a decoder for audio and video in the receiver terminal decodes the audio and video to reproduce the audio and video in the input information order. In the receiver terminal, data whose order is replaced is input to the decoder, usually, decoding of the audio and video does not normally terminate. Specifically, in the receiver terminal, when data whose order is replaced is input, for example, it is assumed that data pieces with sequential numbers 1, 2, and 3 are input to the decoder in the order of 1, 3, and 2. In this case, when receiving 3, the receiver terminal determines that 2 is lost and when inputting 2, the receiver terminal determines that invalid data is input; decoding is not normally performed and consequently, reproduction of the audio and video is temporarily interrupted. As a method to prevent such a situation, a method wherein packets are sorted in a receiver terminal disclosed in Patent Document 1 is known. According to the method, the receiver terminal references the sequential numbers in the packets and sorts the packets according to the numbers, whereby the packets can be input to the decoder as the data in the normal order.